package proxy.generalv1;

import proxy.example.IGamePlayer;

/**
 * @Author：LJ
 * @Description：
 * @Date: 2017/11/27
 * @Modified By:
 */
public class GamePlayer implements IGamePlayer {

    private String name = "";

    //构造函数限制谁能创建对象
    GamePlayer(IGamePlayer iGamePlayer, String name) throws Exception {
        if (iGamePlayer == null) {
            throw new Exception("不能创建真实角色");
        } else {
            this.name = name;
        }
    }

    @Override
    public void login(String name, String password) {
        System.out.println("登录名:" + name + " 密码:" + password);
    }

    @Override
    public void killBoss() {
        System.out.println("打怪");
    }

    @Override
    public void upgrade() {
        System.out.println("升级");
    }
}
